package com.xbts.system.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.Data;
import com.xbts.common.annotation.Excel;
import com.xbts.common.utils.StringUtils;
import com.xbts.common.core.domain.BaseEntity;

import java.io.Serializable;

/**
 * 首页轮播图列对象 cn_setting_home_pic
 *
 * @author xbts
 * @date 2023-09-05
 */
@Data
@ApiModel("首页轮播图列对象")
@TableName("cn_setting_home_pic")
public class CnSettingHomePic implements Serializable {

    private static final long serialVersionUID=1L;

    /** id */
    @TableId
    private String id;

    /** 轮播图1 */
    @Excel(name = "轮播图1")
    @ApiModelProperty("轮播图1")
    @NotEmpty(message = "轮播图1不能为空")
    private String pic;

    /** 跳转地址 */
    @Excel(name = "跳转地址")
    @ApiModelProperty("跳转地址")
    @NotEmpty(message = "跳转地址不能为空")
    private String jumpUrl;

    /** 排序 */
    @Excel(name = "排序")
    @ApiModelProperty("排序")
    @NotEmpty(message = "排序不能为空")
    private Integer sort;

    public<T> QueryWrapper<T> queryWrapper(){
        QueryWrapper<T> queryWrapper=new QueryWrapper<>();
        queryWrapper.like(StringUtils.isNotEmpty(pic),"pic",pic);
        queryWrapper.like(StringUtils.isNotEmpty(jumpUrl),"jump_url",jumpUrl);
        return queryWrapper;
    }
}